<template>
  <div class="wrap">
    <van-address-edit
      :area-list="areaList"
      show-postal
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @save="onSave"
    />
  </div>
</template>
<script>
import { areaList } from "@vant/area-data";
export default {
  data() {
    return {
      areaList,
    };
  },
  computed: {},
  methods: {
    onSave(content) {
      content.id = Date.now().toString(36);
      content.address =
        content.country +
        content.province +
        content.city +
        content.county +
        content.addressDetail;
      this.$store.commit("address/addAddress", content);
      this.$router.push({ name: "user" });
    },
  },
};
</script>
<style lang="scss" scoped>
.wrap {
  padding-top: 46px;
}
</style>
